{include file="public/header" /}
<style>
    .layim-chat-main {
        height: 500px !important;
    }

    .current {
        color: red !important;
    }
</style>
<body>
<div class="layui-fluid layui-anim-fadein">
    <div class="layui-card">
        <div class="layim-chat-main">
            <ul id="LAY_view">
                <li>
                    <div class="layim-chat-user">
                        <img src="{$info.user.photo}">
                        <cite>{$info.user.code}<i>{$info.create_time}</i></cite></div>
                    <div class="layim-chat-text current">{$info.content}</div>
                </li>
                {if $info.images}
                <li>
                    <div class="layim-chat-text" style="margin-top: 2px; width: 200px;height: 200px;">
                        <a href="{$info.images}" target="_blank">
                            <img src="{$info.images}" style="width: auto;height: auto;max-width: 100%;max-height: 100%;">
                        </a>
                    </div>
                </li>
                {/if}
                {if $info.rcomment}
                <li class="layim-chat-mine">
                    <div class="layim-chat-user">
                        <img src="/static/admin/images/default.png">
                        <cite><i>{$info.reply_time}</i>{$info.admin_name}</cite></div>
                    <div class="layim-chat-text">{$info.rcomment}</div>
                </li>
                {/if}
            </ul>
        </div>

        <div class="layim-chat-footer">
            <div class="layim-chat-textarea">
                <textarea id="rcomment" placeholder="请输入回复内容"></textarea>
            </div>
            <div class="layim-chat-bottom">
                <div class="layim-chat-send">
                    <span class="layim-send-btn">回复</span>
                </div>
            </div>
        </div>
    </div>
    <p style="color: red">*Tips:标红的为会员本次留言内容</p>
</div>
</body>
{include file="public/footer" /}
<link rel="stylesheet" href="/static/res/css/layim.css" media="all">
<script>
    $('.layim-chat-main').scrollTop($('.layim-chat-main')[0].scrollHeight);
    $('.layim-chat-send').click(function () {
        var rcomment = $("#rcomment").val();
        if (!rcomment) {
            layer.msg('请输入回复内容');
            return false;
        }
        var load = layer.load();
        $.ajax({
            type: 'POST',
            url: "{:url('save')}",
            data: {id:'{$info.id}',rcomment:rcomment},
            dataType: "json",
            success: function (data) {
                layer.close(load);
                if(data.code == 1){
                    notify.success(data.msg,1500,function (){
                        location.reload();
                    });
                }else{
                    notify.error(data.msg);
                }
            }
        });
    });
</script>
</html>